//
//  CMJCommonCheckGroup.m
//  CMJWeibo
//
//  Created by BH on 15/12/8.
//
//

#import "CMJCommonCheckGroup.h"
#import "CMJCommonCheckItem.h"

@implementation CMJCommonCheckGroup

-(void)setCheckIndex:(NSInteger)checkIndex
{
    _checkIndex = checkIndex;
    
    //屏蔽乱传参数
    NSInteger count = self.items.count;
    if (checkIndex < 0 || checkIndex >= count) {
        return;
    }
    
    for (int i=0; i<count; i++) {
        CMJCommonCheckItem *item = self.items[i];
        if (i == checkIndex) {
            item.checked = YES;
        }else{
            item.checked = NO;
        }
    }
}

@end
